<?php



require(__DIR__ . '/../vendor/autoload.php');
require(__DIR__ . '/../vendor/yiisoft/yii2/Yii.php');


$connection = new \yii\db\Connection([
    'dsn' => 'mysql:host=localhost;dbname=test',
    'username' => 'root',
    'password' => 'th',
    'charset' => 'utf8',
]);
$connection->open();

$command = $connection->createCommand('SELECT * FROM user');
$users = $command->queryAll();
exit(json_encode($users));
